// details.js
import request from '@/utils/request.js';

// 获取所有项目
export const getAllProject = () => {
    return request({
        url: '/project/getAllProject',
        method: 'POST'
    });
};

export const voteProject = (params) => {
    return request({
        url: '/project/vote',
        method: 'POST',
        data: params, // 使用 data 传递 JSON 数据
        headers: {
            'content-type': 'application/json'
        }
    });
};

export const cancelVoteProject = (params) => {
    return request({
        url: '/project/cancelVote',
        method: 'POST',
        data: params, // 使用 data 传递 JSON 数据
        headers: {
            'content-type': 'application/json'
        }
    });
};

export const getRemainingVotes = () => {
    return request({
        url: '/project/getRemainingVotes',
        method: 'POST'
    });
};
export const setRemainingVotes = () => {
    return request({
        url: '/project/setRemainingVotes',
        method: 'POST'
    });
};

export const getVoteId = (data) => {
    return request({
        url: '/project/getVoteId',
        method: 'POST',
		data
    });
};
